package com.zkthink.ceres.promotion.service.impl;

import com.zkthink.base.service.SuperServiceImpl;
import com.zkthink.ceres.promotion.dao.PromotionAuditLogMapper;
import com.zkthink.ceres.promotion.entity.PromotionAuditLog;
import com.zkthink.ceres.promotion.service.PromotionAuditLogService;
import com.zkthink.context.BaseContextHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 业务实现类 营销活动申请日志表
 * </p>
 *
 * @author kellen
 * @date 2020-06-27
 */
@Slf4j
@Service
public class PromotionAuditLogServiceImpl extends
    SuperServiceImpl<PromotionAuditLogMapper, PromotionAuditLog> implements
    PromotionAuditLogService {

  @Override
  public void addLog(Long promotionId, Long applyId, Integer processStage, String remark) {
    String auditName = BaseContextHandler.getName();
    PromotionAuditLog auditLog = PromotionAuditLog.builder().auditBy(auditName).auditRemark(remark)
        .applyId(applyId).promotionId(promotionId).processStage(processStage).build();
    this.save(auditLog);
  }
}
